<?php

namespace common\models\user;

use Yii;

/**
 * This is the model class for table "{{%user_task}}".
 *
 * @property int $id
 * @property int $user_id 用户ID
 * @property int $task_id 任务ID
 * @property string $date
 * @property int $times 任务重复次数
 * @property int $status 完成状态
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 */
class UserTask extends \common\db\ActiveRecord {

    const STATUS_DEFAULT = 0;
    const STATUS_ACTIVE = 10;

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%user_task}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['user_id', 'task_id', 'times', 'status', 'created_at', 'updated_at'], 'integer'],
            [['date'], 'safe'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'user_id' => '用户ID',
            'task_id' => '任务ID',
            'date' => 'Date',
            'times' => '任务重复次数',
            'status' => '完成状态',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ];
    }

}
